<?php
class noticeMod extends commonMod{

	public function index(){
		// 通知列表
		$listarr = __query("SELECT * FROM {tabpre}news WHERE `show`=1 and `recover`=0 order by id desc");
		$this->assign("listarr", $listarr);
		$this->display();
	}
	public function det(){
		//通知详细
		
		$ids = intval($_GET[0]);
		if (empty($ids))
		{
			exit('error 0');
		}
		//数组
		$detarr = __query("SELECT * FROM {tabpre}news WHERE `show`=1 and `recover`=0 and id=".$ids);
		//上页
		$prevarr = __query("SELECT * FROM {tabpre}news WHERE `show`=1 and `recover`=0 and id>'".$ids."' order by id asc  limit 0,1");
		//下页
		$nextarr = __query("SELECT * FROM {tabpre}news WHERE `show`=1 and `recover`=0 and id<'".$ids."' order by id desc limit 0,1");

		$this->assign("detarr", $detarr[0]);
		$this->assign("prevarr", $prevarr[0]);
		$this->assign("nextarr", $nextarr[0]);
		$this->display();
	}
}